package cn.itcast.bos.quartz;

import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import cn.itcast.bos.service.PromotionService;
import cn.itcast.bos.service.WayBillService;

public class PromotionJob implements Job{

	@Autowired
	PromotionService promotionService;
	@Autowired
	private WayBillService wayBillService;
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		System.out.println("活动过期处理程序执行...：当前时间："+new Date());
		promotionService.updateStatus(new Date());
		// 使用定时器完成数据库和索引库同步
		wayBillService.syncIndex();
	}

}
